home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself VRML 2 in 21 Days / Teach Yourself VRML 2 in 21 Days.iso / mac / ISO9660 / 3rdparty / POLYTRAN / dos / PT_DOS.ZIP / DOC_1 / PT.1 < prev    next >
Encoding:
Text File  |  1996-06-13  |  21.6 KB  |  460 lines

  1. .so psroff.inc        # Include the macros needed for output to Postscript
  2. .TH Introduction
  3. .SH NAME
  4. PolyTrans \- A command line interface to the PolyTrans Geometry Conversion Filters
  5. .SH COMMAND SYNTAX
  6. .PP
  7. .nf
  8. pt [import options] [export options] [@filename] list_of_input_files
  9. .fi
  10. .PP
  11. [import options] optionally contains one of the following commands, 
  12. in addition to zero or more options specific to the selected import converter 
  13. (which are themselves described in separate man pages):
  14. .TP
  15.     -i 3ds      = Import a 3D Studio scene, project or material file 
  16. .TP
  17.               (.3ds, .prj, .mli).
  18. .PD 0
  19. .TP
  20.     -i alias    = Import Alias triangle file (.tri)
  21. .TP
  22.     -i cad3d    = Import a CAD 3D binary scene file (.3d2)
  23. .TP
  24.     -i dem      = Import a USGS DEM (Digital Elevation Model) file (.dem)
  25. .TP
  26.     -i dxf      = Import a binary or ASCII DXF file (.dxf)
  27. .TP
  28.     -i iges     = Import an IGES ASCII object file (.igs, .iges)
  29. .TP
  30.     -i ima      = Import an Imagine scene file (.iob, .obj)
  31. .TP
  32.     -i lsa      = Import a Lightscape ASCII object file (.lsa)
  33. .TP
  34.     -i lw       = Import a Lightwave object file (.lw, .lw*, .lwb)
  35. .TP
  36.                    or Lightwave scene files (.lws*, .scn, .scene, scene*)
  37. .TP
  38.     -i nff        = Import Haines NFF file (.nff)
  39. .TP
  40.     -i ng_bdf   = Import a NuGraf binary scene file (.bdf)
  41. .TP
  42.     -i ng_scr   = Import a NuGraf ASCII script file (.scr)
  43. .TP
  44.     -i slp        = Import Pro/Engineer Render file (.slp)
  45. .TP
  46.     -i stl        = Import StereoLithography file (.stl)
  47. .TP
  48.     -i true        = Import Caligari trueSpace files (.cob, .scn)
  49. .TP
  50.     -i vpro     = Import a Vistapro DEM (Digital Elevation Model) file (.dem)
  51. .TP
  52.     -i wave     = Import a Wavefront ASCII object file (.obj)
  53. .PD
  54. .PP
  55. NOTE: This -i command is optional. If not specified then the converter will
  56. try to guess a file's format by matching the input filename's file extension
  57. to one of the file types listed above (ie: .3ds = 3D Studio). The converter
  58. will then examine the file to see if it is the correct format; if the
  59. converter cannot determine the file format type then you must specify
  60. the -i command explicitly.
  61. .PP
  62. [export options] must contain one of the following mandatory commands, 
  63. in addition to
  64. zero or more options specific to the selected export converter (which are 
  65. themselves described in separate man pages):
  66. .TP
  67.     -o 3ds      = Export to a 3D Studio binary file (.3ds)
  68. .PD 0
  69. .TP
  70.     -o dxf      = Export to a DXF ASCII file (.dxf)
  71. .TP
  72.     -o ng_bdf   = Export to a NuGraf binary scene file (.bdf)
  73. .TP
  74.     -o rib      = Export to a RIB ASCII file (.rib)
  75. .TP
  76.     -o opengl   = Export to an Open GL C Code file (.c)
  77. .TP
  78.     -o povray   = Export to a POV-Ray v2.0 ASCII file (.pov)
  79. .TP
  80.     -o wave     = Export to a Wavefront ASCII file (.obj)
  81. .TP
  82.     -o vrml     = Export to a VRML ASCII file (.vrml, .wrl)
  83. .PD
  84. .PP
  85. and 'list_of_scene_files' is one or more input files each of which must have 
  86. the same file extension as listed in the '[import options]' above (ie: a
  87. 3D Studio file name must end in the '.3ds' extension).
  88. .PP
  89. .SH OPTIONAL INPUT BATCH FILE
  90. .PP
  91. An alternative method of specifying the command line arguments is to place
  92. some or all of the arguments within an ASCII text file and have the converter
  93. read the arguments from the command file instead of the command line. The text 
  94. filename is specified by preceeding it with the '@' character on the command
  95. line.
  96. .PP
  97. For example, if the following parameters are placed in the text file 'my_cmds',
  98. .PP
  99. .nf
  100.     # ---------------------------------
  101.     # Argument command file
  102.     -o wave
  103.     -in-lw-compute-normals = on
  104.     -in-lw-print-stats = on
  105.     -in-lw-smoothing-angle = 60.0
  106.     house.lw
  107.     doors.lw
  108.     # ---------------------------------
  109. .fi
  110. .PP
  111. then these arguments can be read into the converter as 'pt @my_cmds'.
  112. .PP
  113. NOTES:
  114. .IP
  115. Any object filenames must be specified LAST in the text file after all other
  116. command line options.
  117. .IP
  118. The text file CANNOT accept wildcard specifications for the filenames, unlike the
  119. command line. For example, on the command line you can use the '*.3ds' to
  120. specify the input filenames but within the text file you must explictly
  121. specify each filename without the wildcard '*' character.
  122. .PP
  123. .SH EXAMPLE COMMAND SYNTAX
  124. .PP
  125. The following section illustrates various ways to execute the PolyTrans program.
  126. .PP
  127. The following example reads in the 3D Studio file called 'testfile.3ds' and
  128. exports it to a DXF file with the same base filename:
  129. .IP
  130. pt -i 3ds -o dxf testfile.3ds
  131. .PP
  132. The following example is the same as the previous example except that no
  133. input format command is given. The converter will try to guess at the
  134. input file's format by looking at its extension (.3ds) then it will examine
  135. the file itself to make sure it is the correct format:
  136. .IP
  137. pt -o dxf testfile.3ds
  138. .PP
  139. This example will read in some of the arguments from the ASCII text file
  140. 'my_args' (as shown above) and specify some additional input objects:
  141. .IP
  142. pt @my_args window.lw lights.lw
  143. .PP
  144. This example shows how explicit import and export directories can be
  145. specified. All files will be read from the '-id' directory and saved out
  146. to the '-od' directory:
  147. .IP
  148. pt -id = "c:\input" -od = "c:\output" -o vrml bike.lw
  149. .PP
  150. This example batch converts a variety of input formats to a single 3D Studio 
  151. output file:
  152. .IP
  153. pt -of = output.3ds -o 3ds bike.lw table.obj desk.dxf
  154. .PP
  155. Again, this batch converts all Wavefront files located in the input directory
  156. to separate DXF output files:
  157. .IP
  158. pt -i wave -o dxf *.obj
  159. .PP
  160. .SH COMMON COMMAND LINE OPTIONS
  161. .PP
  162. The following options are common to all import/export converters. All
  163. other options are listed in separate man pages:
  164. .TP
  165. -of = "output filename"
  166. This option specifies an explicit filename that all imported file(s) are
  167. to be saved out to. For example, if the command is specified as
  168. "-of = mydata -o 3ds file1.obj file2.igs" then the two input files will be 
  169. saved out to the filename "mydata.3ds". Note that no file extension (such as ".3ds") 
  170. is required because the program will automatically append it for you. 
  171. If this '-of' option is not specified then each imported
  172. file will be exported to a unique file with the same root filename as the
  173. input filename but with the file extension changed (ie: input.3ds -> input.obj). 
  174. .TP
  175. -id = "directory path"
  176. This option allows a directory path to be specified where all input
  177. file(s) will be read from. For example, "-id = c:\input" will cause all 
  178. files to be read in from the top-most "input" directory located
  179. on disk drive C. UNIX or DOS-based pathnames are valid. If a file is
  180. not found then it will be searched for in the list of directories contained
  181. in the environment variables 'NG_SEARCHPATH_OBJECTS' and 'NG_SEARCHPATH_DEFAULT'
  182. (see explanation below). 
  183. .TP
  184. -od = "directory path"
  185. This option allows a directory path to be specified where all exported
  186. file(s) will be stored. For example, "-od = c:\exported" will cause all 
  187. exported files to be placed in the top-most "exported" directory located
  188. on disk drive C. UNIX or DOS-based pathnames are valid.
  189. .TP
  190. -backupfiles = [ on | off ]
  191. This option allows the program to create a backup file if a file is
  192. about to be overwritten with a new version. For example, if the program
  193. is about to output a new file called "file.3ds" which already exists 
  194. on disk then the program will first rename the current version to "file.bak"
  195. before writing the new version. If backup copies of the file already exist
  196. from previous executions of the translator program then the backup file
  197. extension will use sequential numbers (for example, "file.bk1", "file.bk2").
  198. Thus, successive backups will use the file extensions: .bak, .bk2,. bk3, etc.
  199. .TP
  200. -confirmoverwrites = [ on | off ]
  201. Enable or disable the confirmation of file overwrites. If set to 'off'
  202. then files are always overwritten without user confirmation. If set to 'on'
  203. (the default) then potential file overwrites are always confirmed by the user.
  204. This option is ignored if the '-backupfiles' option is set to 'on' in which
  205. case backup files will always be created.
  206. .TP
  207. -quiet = [ on | off ]
  208. Enable or disable all printing to the console window. It is 'off' by
  209. default, allowing all messages to be displayed to the console window.
  210. .PP
  211. .SH POLYGON PROCESSING FUNCTIONS
  212. .PP
  213. The following command line options provide access to functions that operate on 
  214. raw polygon data, such as removing redundant vertices, unifying the
  215. direction of normals and adding vertex normals (used to create a 'smooth' 
  216. appearance for the data). Note that these functions are only applicable to
  217. objects which contain polygon data (they are not used on objects which
  218. contain NURBs, bicubic patches or solid objects). These polygon processing
  219. functions, if enabled, are applied to the polygon data after it has been
  220. imported into the internal database but before it has been exported.
  221. .PP
  222. Note that in most cases you will not have to use these functions since most
  223. of the import converters process their input data automatically (such as in
  224. the DXF and IGES readers) using these same polygon processing functions. 
  225. Nevertheless, you can enable these functions if you want to fine tune the
  226. data before it is exported.
  227. .PP
  228. Six functions are available and are performed in the order as specified as
  229. follows:
  230. .TP
  231. -weldvertices = <threshold distance>
  232. This function will delete all redundant vertices which are within a specified 
  233. distance of each other. The distance value is specified with the floating
  234. point <threshold distance> parameter. To enable this function use a value 
  235. >= 0.0 (a value of 0.001 is appropriate for some datasets). Note that the
  236. threshold value is dependent upon the size of your dataset; basically
  237. you will have to make an educated guess at a good <threshold distance>
  238. value. Please note that this function can become VERY SLOW for data sets 
  239. with thousands of polygons in it (every vertex must be compared against 
  240. every other vertex). To disable this function set the <threshold distance>
  241. parameter to -1 or else do not specify this option on the command line.
  242. .TP
  243. -unifynormals = [ yes | no ]
  244. For some 3d models, in particular those created using Autodesk's AutoCAD, there 
  245. is no consistent orientation of the polygons; ie: some polygons of a surface 
  246. are oriented clockwise (the geometric normal points inward) while the 
  247. remaining polygons are oriented counterclockwise (the geometric normal points 
  248. outward). This is a problem for the '-autosmooth' option shown below since 
  249. all of the polygons must have the same orientation in order for the smoothed 
  250. vertex normals to be computed properly.
  251. .IP
  252. If this option is enabled (set to 'yes') then a special algorithm will be used 
  253. to walk over the polygon mesh and reorient each polygon. Note, however, that 
  254. adjacent polygons MUST share the same vertices for this algorithm to work; 
  255. you can ensure that the vertices are shared by enabling the '-weldvertices'
  256. option above.
  257. .TP
  258. -flipnormals = [ outward | inward | disabled ]
  259. If this option is set to 'inward', and the program determines that most of 
  260. the geometric normals of the polygon data point outwards, then this routine 
  261. will reverse the orientation of all polygons and flip their vertex normals so 
  262. that the majority of geometric normals point inward towards the centroid of 
  263. the polygon data. 
  264. .IP
  265. If this option is set to 'outward', and the program determines that most of 
  266. the geometric normals of the polygon data point inwards, then this routine 
  267. will reverse the orientation of all polygons and flip their vertex normals so 
  268. that the majority of geometric normals point outward away from the centroid of 
  269. the polygon data. 
  270. .IP
  271. To disable the '-flipnormals' function use the 'disabled' option, or don't
  272. specify this option on the command line.
  273. .TP
  274. -autosmooth = <angle in degrees>
  275. This is a very useful function which automatically creates vertex normals for 
  276. polygonal data that does not have any. Vertex normals are an integral part of 
  277. the rendering process which basically describe the 'smoothness' or 'curvature' 
  278. of an object. For example, even though a sphere is made up of flat polygons 
  279. it appears smooth after rendering because of the precise vertex normals assigned 
  280. to it. 
  281. .IP
  282. Many objects that you will read into this translator program will not contain 
  283. vertex normals, or the vertex normals they do contain may not be to your 
  284. liking. In this case you can use this function to compute new vertex normals 
  285. for the data. The vertex normals are computed based on the angle between 
  286. abutting polygons; if the angle between the geometric surface normals of 
  287. abutting polygons is less than the <angle in degrees> parameter then common 
  288. vertex normals will be assigned to the polygons (they will be smoothed); thus, 
  289. higher values make the object appear to be smoother and have less sharp corners.
  290. The range for the <angle in degrees> parameter is 1 to 180 degrees (this
  291. function can be disabled by setting this parameter to 0).
  292. .IP
  293. This function can be applied to the data as many times as you like (you can keep 
  294. increasing the smoothing angle argument until the geometry looks good).
  295. .IP
  296. NOTE that smoothed normals can only be created if abutting polygons share the same 
  297. vertices. This will be the case for most data, but for some data (such as polygons read in 
  298. via the IGES converter) each polygon will have its own unique vertex copies. In this case 
  299. you have to apply the '-weldvertices' function described above before you 
  300. smooth out the data.
  301. .IP
  302. ALSO NOTE that the geometric normals of the polygons must be oriented consistently; 
  303. ie: the normals belonging to neighbouring polygons must be on the same side of all 
  304. polygons. If this is not the case then enable the Make polygon orientations consistent 
  305. option above.
  306. .IP
  307. In closing, if the '-autosmooth' function reports '0 normals computed' then:
  308. .IP
  309. Apply the '-weldvertices' function to the data and try again.
  310. .IP
  311. Or, this object does not have any raw polygons in it so ignore the problem.
  312. .TP
  313. -weldothers = <threshold distance>
  314. This is the same as the '-weldvertices' function except that it combines redundant 
  315. normals, texture coordinates, colors, U tangent vectors and V tangent vectors
  316. of the polygon data that are within a certain threshold of each other. In most cases 
  317. this function is not required. An appropriate value for <threshold distance>
  318. is 0.001. To disable this function set the <threshold distance> parameter to
  319. -1 or don't specify it on the command line.
  320. .TP
  321. -flipallnormals = [ yes | no ]
  322. If this option is enabled then the orientation of all vertex normals 
  323. will be flipped. For example, if the vertex normals of the object currently all face 
  324. inward then this function will cause all of the vertex normals to face outward.
  325. .TP
  326. -removedblsided = <threshold distance>
  327. Some modeling and rendering programs create what are called "double sided 
  328. polygons" which are actually two identical polygons that share the same 
  329. location in space except that they have opposite orientations (the geometric 
  330. face normals point in opposite directions). These double sided polygons can 
  331. cause major problems with other rendering programs which cannot handle double 
  332. sided polygons - in this case the '-removedblsided' option can be enabled 
  333. which will remove all such duplicated polygons. Two polygons are considered to 
  334. be "double sided" if each corresponding vertex is within a maximum distance of 
  335. each other - this maximum distance is set with the <threshold distance>
  336. parameter. If this parameter is set to 0 then both polygons must be situated 
  337. in exactly the same location in space, else the parameter can be increased 
  338. to provide for leeway between vertex locations (a value between 0.000001 
  339. and 0.001 should be fine).
  340. .PP
  341. .SH OVERVIEW OF THE POLYTRANS PROGRAM
  342. .PP
  343. PolyTrans is a command line interface to the suite of PolyTrans Geometry Conversion 
  344. Filters that convert between various 3D geometry file formats. This program
  345. is based upon the same code used in the NuGraf Rendering System, which is 
  346. a high-end, interactive rendering and visualization program. Since this program is based on
  347. a highly complex rendering system it can import, convert and export
  348. many more entities and attributes than most other polygon format converters,
  349. and with much more flexibility.
  350. .PP
  351. Whereas other converters will only read in straight polygon data, PolyTrans
  352. will read in many higher-order entities such as NURB and Bicubic patches, 
  353. a variety of indexed and meshed polygon formats, and a variety of quadric 
  354. primitives such as spheres and cones. In addition, PolyTrans will also read in
  355. all material attributes, cameras, lights and other scene data associated
  356. with the input file (where appropriate).
  357. .PP
  358. The real power of the PolyTrans program lies in its output converters. 
  359. As part of the conversion process PolyTrans can accommodate any type of output
  360. format, from the simplistic DXF format to complex formats such as RIB
  361. and 3D Studio. In terms of the simplistic output formats (such as DXF), the converters
  362. will convert all input entities to polygons. For example, if an input
  363. file contains NURB patches and spheres, then the converter will
  364. tessellate these higher-order entities directly into polygons. On the other
  365. hand, if the output format can accommodate higher-order entities, such as
  366. the RIB format, then the converter will output the entities in their
  367. original input form (NURB or Bicubic patches, spheres, or just meshed
  368. polygons). Thus, input entities are not broken down into polygons unless
  369. absolutely required by the output format.
  370. .PP
  371. A technically advanced feature of the conversion process is the use of a 
  372. unique memory allocation and memory management system. This system, which
  373. is used by the various import and export filters, as well as the internal 
  374. database manager, allows huge databases to be converted on machines with 
  375. minimal memory. Rather than allocate numerous small chunks of memory, the
  376. manager allocates large blocks of memory whose size is determined by the
  377. converter; the DXF and Wavefront import filters, for example, greatly benefit
  378. from this memory manager since hundreds of thousands of small memory
  379. elements must be allocated during the import process. In addition, the 
  380. import converters
  381. store all polygon data within the database using a compressed mesh format
  382. which uses various techniques to reduce memory usage (such as sharing the
  383. normal/texture/color/etc index arrays with those of the vertex index array).
  384. All this adds up to an efficient use of memory resources.
  385. .PP
  386. A wide selection of other output options allow the converters to automatically 
  387. triangulate the output data, cut holes out of meshes (when necessary) and 
  388. tear apart the input data according
  389. to material assignment or grouping (refer to the RIB and Wavefront export
  390. modules). In addition, the converters always output optimized polygon
  391. meshes wherever possible, regardless of the form or structure of the
  392. input polygon data (arbitrary polygon input data is always welded, optimized and 
  393. any redundant polygon coordinates removed before being output).
  394. In general the converters can convert any form of input to any form of output.
  395. .PP
  396. Another important feature of the converters is that they convert _all_
  397. attributes associated with a polygon mesh, such as the vertex normals, 
  398. vertex colors, u/v texture coordinates and U/V tangent vectors.
  399. The texture coordinates are particularly important when converting polygon 
  400. data.
  401. .PP
  402. .SH SETUP FILE
  403. .PP
  404. When the PolyTrans program initializes it looks for a setup file which contains
  405. all of the default settings for the various import/export converters.
  406. This setup file is loaded in after the program has initialized but before any 
  407. command line arguments are processed or any object files loaded (thus the 
  408. command line arguments override the options specified in the setup file).
  409. .PP
  410. The name of the setup file is different for each different operating
  411. system and machine type:
  412. .nf
  413.     setup.sgi    - Silicon Graphics
  414.     setup.sun    - SUN Microsystems
  415.     setup.dos    - MSDOS or Windows 95/NT command line version
  416.     setup.lnx    - Linux
  417.     setup.ini     - If none of the above are found
  418. .fi
  419. .PP
  420. .SH INPUT FILENAME SEARCH PATHS
  421. .PP
  422. When opening the input object files the converter will search several other
  423. directories if it does not find a file in the current directory. These
  424. alternative search paths are listed at the end of the 'setup.ini' file.
  425. .PP
  426. The default search paths are defined as such:
  427. .PP
  428. .nf
  429.    NG_SEARCHPATH_DEFAULT = "$(NG_WORKING_DIR);$(NG_WORKING_DIR)/objects"
  430.    NG_SEARCHPATH_OBJECTS = "$(NG_WORKING_DIR);$(NG_WORKING_DIR)/objects"
  431. .fi
  432. .PP
  433. The input file will first be searched for in the directories listed in the
  434. NG_SEARCHPATH_OBJECTS environment variable then in the directories listed
  435. in the NG_SEARCHPATH_DEFAULT environment variable. Each directory is
  436. separated by a comma in each environment variable.
  437. .PP
  438. Upon startup of the converter, the $(NG_WORKING_DIR) argument shown above will
  439. be replaced with the directory name where the converter program was first 
  440. executed.
  441. .PP
  442. In addition, you can specify an explicit input directory on the command
  443. line using the '-id' option (which is described above).
  444. .PP
  445. .SH OUTPUT ERROR LOG
  446. .PP
  447. All errors and warnings from this program will be logged in the file
  448. 'errors.log'.
  449. .SH COPYRIGHTS
  450. This software is Copyright (c) 1988-1996 Okino Computer Graphics, Inc. All Rights Reserved.
  451. .SH TRADEMARKS
  452. .PP
  453. PolyTrans is a trademark of Okino Computer Graphics, Inc.
  454. NuGraf is a registered trademark of Okino Computer Graphics, Inc.
  455. .PP
  456. Rather than put a trademark symbol in every occurrence of other trademarked
  457. names, we state that we are using the names only in an editorial
  458. fashion, and to the benefit of the trademark owner, with no intention
  459. of infringement of the trademark.
  460.